package com.netease.c;

import java.util.Hashtable;

class g
{
  public static final int a = 0;
  public static final int b = 1;
  public static final int c = 2;
  public static final int d = 3;
  public static final int e = 4;
  private static final char[] f = "<br".toCharArray();
  private static final char[] g = "<p".toCharArray();
  private static final char[] h = "<li".toCharArray();
  private static final char[] i = "<pre".toCharArray();
  private static final char[] j = "<hr".toCharArray();
  private static final char[] k = "</td>".toCharArray();
  private static final char[] l = "</tr>".toCharArray();
  private static final char[] m = "</li>".toCharArray();
  private static final Hashtable n = new Hashtable();
  private int o;
  private String p;
  private String q = null;
  private int r = 0;
  private boolean s = false;

  static
  {
    n.put("<", "<");
    n.put(">", ">");
    n.put("&", "&");
    n.put("?", "(r)");
    n.put("?", "(c)");
    n.put(" ", " ");
    n.put("￡", "?");
  }

  public g(int paramInt1, char[] paramArrayOfChar, int paramInt2, int paramInt3, boolean paramBoolean)
  {
    this.o = paramInt1;
    this.r = (paramInt3 - paramInt2);
    this.p = new String(paramArrayOfChar, paramInt2, this.r);
    a(paramBoolean);
  }

  private int a(char[] paramArrayOfChar, int paramInt1, char paramChar, int paramInt2)
  {
    int i1 = paramInt1 + paramInt2;
    if (i1 > paramArrayOfChar.length)
      i1 = paramArrayOfChar.length;
    int i2 = paramInt1;
    if (i2 < i1)
      if (paramArrayOfChar[i2] != paramChar);
    for (int i3 = 1 + (i2 - paramInt1); ; i3 = -1)
    {
      return i3;
      i2++;
      break;
    }
  }

  private String a(String paramString, boolean paramBoolean)
  {
    char[] arrayOfChar = paramString.toCharArray();
    StringBuffer localStringBuffer1 = new StringBuffer(arrayOfChar.length);
    int i1 = 0;
    Object localObject = localStringBuffer1;
    int i2 = 0;
    while (true)
    {
      if (i1 >= arrayOfChar.length)
        return c.b(((StringBuffer)localObject).toString());
      char c1 = arrayOfChar[i1];
      if (i1 + 1 < arrayOfChar.length);
      for (int i3 = arrayOfChar[(i1 + 1)]; ; i3 = 0)
      {
        if (c1 != ' ')
          break label105;
        if ((paramBoolean) || (i2 == 0))
          localObject = ((StringBuffer)localObject).append(' ');
        i2 = 1;
        i1++;
        break;
      }
      label105: if ((c1 == '\r') && (i3 == 10))
      {
        if (paramBoolean)
          localObject = ((StringBuffer)localObject).append('\n');
        i1 += 2;
        continue;
      }
      if ((c1 == '\n') || (c1 == '\r'))
      {
        if (paramBoolean)
          localObject = ((StringBuffer)localObject).append('\n');
        i1++;
        continue;
      }
      if (c1 == '&')
      {
        int i4 = a(arrayOfChar, i1, ';', 10);
        if (i4 == -1)
        {
          localObject = ((StringBuffer)localObject).append('&');
          i1++;
          i2 = 0;
          continue;
        }
        String str1 = new String(arrayOfChar, i1, i4);
        String str2 = (String)n.get(str1);
        if (str2 != null)
        {
          localObject = ((StringBuffer)localObject).append(str2);
          i1 += i4;
          i2 = 0;
          continue;
        }
        if (i3 == 35)
        {
          String str3 = new String(arrayOfChar, i1 + 2, i4 - 3);
          try
          {
            int i5 = Integer.parseInt(str3);
            if ((i5 > 0) && (i5 < 65536))
            {
              StringBuffer localStringBuffer2 = ((StringBuffer)localObject).append((char)i5);
              localObject = localStringBuffer2;
              i1++;
              i2 = 0;
            }
          }
          catch (Exception localException)
          {
            localException.printStackTrace();
            localObject = ((StringBuffer)localObject).append("&#");
            i1 += 2;
            i2 = 0;
          }
          continue;
        }
        localObject = ((StringBuffer)localObject).append('&');
        i1++;
        i2 = 0;
        continue;
      }
      localObject = ((StringBuffer)localObject).append(c1);
      i1++;
      i2 = 0;
    }
  }

  private void a(boolean paramBoolean)
  {
    char[] arrayOfChar;
    if (this.o == 2)
    {
      arrayOfChar = this.p.toCharArray();
      if ((a(f, arrayOfChar)) || (a(g, arrayOfChar)))
        this.q = "\n";
    }
    while (true)
    {
      return;
      if (a(h, arrayOfChar))
      {
        this.q = "\n* ";
        continue;
      }
      if (a(i, arrayOfChar))
      {
        this.s = true;
        continue;
      }
      if (a(j, arrayOfChar))
      {
        this.q = "\n--------\n";
        continue;
      }
      if (b(k, arrayOfChar))
      {
        this.q = "\t";
        continue;
      }
      if ((!b(l, arrayOfChar)) && (!b(m, arrayOfChar)))
        continue;
      this.q = "\n";
      continue;
      if (this.o != 0)
        continue;
      this.q = a(this.p, paramBoolean);
    }
  }

  private boolean a(char[] paramArrayOfChar1, char[] paramArrayOfChar2)
  {
    int i1 = 0;
    if (paramArrayOfChar1.length >= paramArrayOfChar2.length);
    while (true)
    {
      return i1;
      for (int i2 = 0; ; i2++)
      {
        if (i2 >= paramArrayOfChar1.length)
          break label41;
        if (Character.toLowerCase(paramArrayOfChar2[i2]) != paramArrayOfChar1[i2])
          break;
      }
      label41: if (paramArrayOfChar2.length > paramArrayOfChar1.length)
      {
        int i3 = Character.toLowerCase(paramArrayOfChar2[paramArrayOfChar1.length]);
        if ((i3 >= 97) && (i3 <= 122))
          continue;
        i1 = 1;
        continue;
      }
      i1 = 1;
    }
  }

  private boolean b(char[] paramArrayOfChar1, char[] paramArrayOfChar2)
  {
    int i1 = 0;
    if (paramArrayOfChar1.length > paramArrayOfChar2.length);
    while (true)
    {
      return i1;
      for (int i2 = 0; ; i2++)
      {
        if (i2 >= paramArrayOfChar1.length)
          break label41;
        if (Character.toLowerCase(paramArrayOfChar2[i2]) != paramArrayOfChar1[i2])
          break;
      }
      label41: i1 = 1;
    }
  }

  public int a()
  {
    return this.r;
  }

  public boolean b()
  {
    return this.s;
  }

  public String c()
  {
    if (this.q == null);
    for (String str = ""; ; str = this.q)
      return str;
  }

  public String toString()
  {
    return this.p;
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.c.g
 * JD-Core Version:    0.6.0
 */